package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanhua.dubbo.mappers.AnswerMapper;
import com.tanhua.model.soul.Answer;
import org.apache.dubbo.config.annotation.DubboService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService
public class AnswerApiImpl implements AnswerApi {
    @Autowired
    private AnswerMapper answerMapper;

    @Override
    public int findAnswer(int problemId, int optionId) {
        LambdaQueryWrapper<Answer> qw=new LambdaQueryWrapper<>();
        qw.eq(Answer::getProblemId,problemId).eq(Answer::getOptionId,optionId);
        Answer answer = answerMapper.selectOne(qw);
        return answer.getGrade();

    }
}
